Skip to content

Conversation

aspeddro
Copy link
Collaborator

@aspeddro aspeddro commented Feb 9, 2022

This PR add basic support to indents.

Some cases that have not been implemented:

Variant

type user = 
  | Id
  | Name
2022-02-10_17-05_15.mp4

How to set the node/rule where indentation ends?

Labeled Variant Payloads (Inline Record)

| is the cursor

type user =
  | Id
  | Name({|})

Press enter:

type user =
  | Id
  | Name({
  |
  })

Here the indentation not work because Name({}) is a ERROR. record_type rule require a field

ERROR [0, 0] - [2, 12]
  type_identifier [0, 5] - [0, 9]
  variant_declaration [1, 4] - [1, 6]
    variant_identifier [1, 4] - [1, 6]
  variant_identifier [2, 4] - [2, 8]

Could record_type be an optional rule to not generate an ERROR node in the parser?

@aspeddro aspeddro marked this pull request as draft November 5, 2022 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants